let brandtitleid = getQueryString('brandtitleid')
let ul = document.querySelector('section ul')

const xhr1 = new XMLHttpRequest()
xhr1.open("get",`http://chst.vip:1234/api/getbrandproductlist?brandtitleid=${brandtitleid}`)
xhr1.onload = function(){
    let res = JSON.parse(xhr1.responseText)
    // console.log(res)
    let res1 = res.result
    console.log(res1);
    let lis =''

    res1.forEach(item => {
        lis +=
        `
        <li productId=${item.productId}>
                
                    <div class="tu">
                    ${item.productImg}
                    </div>


                    <div class="righ">
                        <div class="shang">
                            <h4>${item.productName}</h4>
                            <div>${item.productPrice}</div>
                        </div>

                        <div class="xia">
                            <span>${item.productQuote}</span>
                            <i></i>
                            <span>${item.productCom}</span>
                        </div>
                    </div>
                
            </li>
        `
    })
    ul.innerHTML = lis
}
xhr1.send(null)

$('ul').on('click','li',function(){
    let productid = $(this).attr('productid')
    console.log(productid);
    location.href = `./page12-1-1.html?productid=${productid}`
})